/* 
 * Created on 14. August 2008, 11:41
 *
 *      Copyright 2008 Oliver Eichner <o.eichner@gmail.com>
 *      
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 3 of the License, or
 *      (at your option) any later version.
 *      
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */

/**
 * @file Device.h
 * Device Class header
 */

#ifndef _DEVICE_H
#define	_DEVICE_H

#include <stdio.h>
#include <stdlib.h>
#include <sstream>
#include <fstream>
#include <iostream>
#include <string>

using namespace std;

/**
 * @class Device
 * The Device class, one object per device wich stores tableau-parm informations..
 * @author Oliver Eichner
 * @version 0.3
 */
class Device {
public:
    Device(string devName);
    
    ~Device();

    virtual void setComment(string nComment);

    virtual string getComment();
    string getDeviceName();
    string getVendor();
    string getModel();
    string getSerial();
    string getSize();
    int getSizeMB();
    string getSizeBLK();
    
    //tableau-parm getter
     //## Bridge Information ##
    string getBridge_chan_index();
    string getBridge_chan_type();
    bool getBridge_writes_permitted();
    bool getBridge_declare_write_blocked();
    bool getBridge_declare_write_errors();
    string getBridge_serial();
    string getBridge_vendor();
    string getBridge_model();
    string getBridge_firmware_date();
    string getBridge_firmware_time();
    // ## Drive Information ##
    string getBridge_drive_vendor();
    string getBridge_drive_model();
    string getBridge_drive_serial();
    string getBridge_drive_revision();

    //## Drive HPA/DCO/Security Information ##
    bool getBridge_security_in_use();
    bool getBridge_security_support();
    bool getBridge_hpa_in_use();
    bool getBridge_hpa_support();
    bool getBridge_dco_in_use();
    bool getBridge_dco_support();
    string getBridge_drive_capacity();
    string getBridge_hpa_capacity();
    string getBridge_dco_capacity();
    string getBridge_dco_challenge_key();

private:
    string comment;
    string deviceName;
    string vendor;
    string model;
    string size;
    string bus; // atm not in use

    //tableau-parm vars
    //## Bridge Information ##
    string bridge_chan_index;
    string bridge_chan_type;
    bool bridge_writes_permitted;
    bool bridge_declare_write_blocked;
    bool bridge_declare_write_errors;
    string bridge_serial;
    string bridge_vendor;
    string bridge_model;
    string bridge_firmware_date;
    string bridge_firmware_time;
    // ## Drive Information ##
    string bridge_drive_vendor;
    string bridge_drive_model;
    string bridge_drive_serial;
    string bridge_drive_revision;

    //## Drive HPA/DCO/Security Information ##
    bool bridge_security_in_use;
    bool bridge_security_support;
    bool bridge_hpa_in_use;
    bool bridge_hpa_support;
    bool bridge_dco_in_use;
    bool bridge_dco_support;
    string bridge_drive_capacity;
    string bridge_hpa_capacity;
    string bridge_dco_capacity;
    string bridge_dco_challenge_key;


    long int sizeBlk;
    string sizeBlkString;
    int sizeMB;
    void fetchSys();
    void fetchTableauParmStats();

};

#endif	/* _DEVICE_H */

